<html>
<head><meta charset="utf-8"><title>Name of async/await code transformation · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Name.20of.20async.2Fawait.20code.20transformation.html">Name of async/await code transformation</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="214256537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Name%20of%20async/await%20code%20transformation/near/214256537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Diggsey <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Name.20of.20async.2Fawait.20code.20transformation.html#214256537">(Oct 22 2020 at 22:39)</a>:</h4>
<p>Is there a name for the generic transformation that is used by the compiler for async/await, generators, etc. when a piece of sequential code is transformed into a state machine?</p>



<a name="214256654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Name%20of%20async/await%20code%20transformation/near/214256654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Name.20of.20async.2Fawait.20code.20transformation.html#214256654">(Oct 22 2020 at 22:41)</a>:</h4>
<p>we usually call it "state machine transform" or "generator lowering"</p>



<a name="214256782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Name%20of%20async/await%20code%20transformation/near/214256782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Diggsey <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Name.20of.20async.2Fawait.20code.20transformation.html#214256782">(Oct 22 2020 at 22:42)</a>:</h4>
<p>ah ok, I thought there might be specific terminology, as it's not unique to Rust</p>



<a name="214257073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Name%20of%20async/await%20code%20transformation/near/214257073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Name.20of.20async.2Fawait.20code.20transformation.html#214257073">(Oct 22 2020 at 22:47)</a>:</h4>
<p>the Y-combinator <span aria-label="joking" class="emoji emoji-1f61c" role="img" title="joking">:joking:</span></p>



<a name="214257141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Name%20of%20async/await%20code%20transformation/near/214257141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Name.20of.20async.2Fawait.20code.20transformation.html#214257141">(Oct 22 2020 at 22:48)</a>:</h4>
<p>...actually let me check my notes on lambda compilation, I think there might be a formal name for it there.</p>



<a name="214260922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Name%20of%20async/await%20code%20transformation/near/214260922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Name.20of.20async.2Fawait.20code.20transformation.html#214260922">(Oct 22 2020 at 23:46)</a>:</h4>
<p><span class="user-mention" data-user-id="295632">@Diggory Blake</span> I don't remember a common name for it in C# either (which also uses it for await and yield)</p>



<a name="214409082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Name%20of%20async/await%20code%20transformation/near/214409082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Name.20of.20async.2Fawait.20code.20transformation.html#214409082">(Oct 24 2020 at 04:42)</a>:</h4>
<p>I was thinking of this and the transformation of lambda terms via abstraction elimination / term rewriting to SK combinators (which can form a graph, which can then be evaluated via graph reduction). <a href="https://en.wikipedia.org/wiki/SKI_combinator_calculus">https://en.wikipedia.org/wiki/SKI_combinator_calculus</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>